<template>
 
    <div class="address-edit">
      <div class="xtx-form">
        <div class="xtx-form-item">
          <div class="label">收货人：</div>
          <div class="field">
            <input class="input" placeholder="请输入收货人" v-model="formData.receiver"/>
          </div>
        </div>
        <div class="xtx-form-item">
          <div class="label">手机号：</div>
          <div class="field">
            <input class="input" placeholder="请输入手机号" v-model="formData.contact"/>
          </div>
        </div>
        <div class="xtx-form-item">
          <div class="label">地区：</div>
          <div class="field">
            <XtxCity
              placeholder="请选择所在地区"
              :fullCitydata="fullCitydata"
              @setFulldata="changeFulldata"
            />
          </div>
        </div>
        <div class="xtx-form-item">
          <div class="label">详细地址：</div>
          <div class="field">
            <input class="input" placeholder="请输入详细地址" v-model="formData.address"/>
          </div>
        </div>
        <div class="xtx-form-item">
          <div class="label">邮政编码：</div>
          <div class="field">
            <input class="input" placeholder="请输入邮政编码" v-model="formData.postalCode" />
          </div>
        </div>
        <div class="xtx-form-item">
          <div class="label">地址标签：</div>
          <div class="field">
            <input class="input" placeholder="请输入地址标签，逗号分隔" v-model="formData.addressTags"/>
          </div>
        </div>
      </div>
      <!-- {{ formData }} -->
    </div>
</template>
<script>
import XtxCity from "../goodsdetail/cityview.vue";
import XtxDialog from "./confirm.vue";
export default {
  name: "AddressEdit",
  components: { XtxCity, XtxDialog },
  props:['formData'],
  data() {
    return {
      fullCitydata: {
        procode: null,
        proname: "北京市",
        citycode: null,
        cityname: "市辖区",
        coucode: null,
        couname: "东城区",
      },
    };
  },
  methods: {
    changeFulldata(obj) {
      this.fullCitydata = obj;
      this.formData.provinceCode=this.fullCitydata.procode
      this.formData.cityCode=this.fullCitydata.citycode
      this.formData.countyCode=this.fullCitydata.coucode
    },
  },
};
</script>
<style scoped lang="scss">
@import "@/assets/css/color.scss";
.address-edit {
  .xtx-dialog {
    :deep(.wrapper) {
      width: 780px;
      .body {
        font-size: 14px;
      }
    }
  }
  .xtx-form {
    padding: 0;
    input {
      outline: none;
      &::placeholder {
        color: #ccc;
      }
    }
  }
  .xtx-city {
    width: 320px;
    :deep(.select) {
      height: 50px;
      line-height: 48px;
      display: flex;
      padding: 0 10px;
      justify-content: space-between;
      .placeholder {
        color: #ccc;
      }
      i {
        color: #ccc;
        font-size: 18px;
      }
      .value {
        font-size: 14px;
      }
    }
    :deep(.option) {
      top: 49px;
    }
  }
}
</style>
